package com.hmdp.exception;

/**
 * date: 2023/9/9 10:17
 * author: MR.孙
 */

public class BaseException extends RuntimeException{

    Object data;

    String message;

    public BaseException(String message) {
        this(message, null);
    }

    public BaseException(Object data) {
        this("业务异常", data);
    }

    public BaseException(String message, Object data) {
        super(message);
        this.data= data;
        this.message = message;
    }

    public BaseException(Object data, String message, Throwable cause) {
        super(message, cause);
        this.message = message;
        this.data = data;
    }


    public Object getData() {
        return data;
    }


    public String getMessage() {
        return message;
    }
}
